import os
from waitress import serve
from app import app

if __name__ == '__main__':
    # 设置生产环境
    os.environ['FLASK_ENV'] = 'production'
    
    # 配置日志
    if not os.path.exists('logs'):
        os.makedirs('logs')
    
    # 启动服务器
    print('Starting production server...')
    serve(app, host='0.0.0.0', port=5000, threads=4) 